package me.learningandroid.ch2_2.intentdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class IntentWithExtraDataActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_intent_with_extra_data);

        TextView textView = (TextView) findViewById(R.id.text_id);

        // 目标活动接收到的intent，通过`Activity`成员方法`getIntent`获取
        Intent intent = getIntent();

        textView.setText(intent.getExtras().toString());
    }
}